package net.entelijan.cobean.examples.lit;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;

import net.entelijan.cobean.examples.util.ExamplesUtil;
import net.miginfocom.swing.MigLayout;

public class BookListPanel extends JPanel {

	private static final long serialVersionUID = 1L;

	private JButton searchButton = new JButton("Search");

	private JTextField searchTitleTextField = new JTextField();

	private JTextField searchYearTextField = new JTextField();

	private JTextField searchAuthorTextField = new JTextField();

	private JButton newButton = new JButton("New");

	private JButton editButton = new JButton("Edit");

	private JButton deleteButton = new JButton("Delete");

	private JTable authorsTable = new JTable();

	public BookListPanel() {
		super();
		setLayout(new MigLayout());
		{
			add(new JLabel("Title"), "");
			add(this.searchTitleTextField, "w max, wrap");
		}
		{
			add(new JLabel("Year"), "");
			add(this.searchYearTextField, "w max, wrap");
		}
		{
			add(new JLabel("Author"), "");
			add(this.searchAuthorTextField, "w max, wrap");
		}
		add(ExamplesUtil.createButtonsPanel(100, this.searchButton),
				"w max, span 2, wrap");
		add(new JScrollPane(this.authorsTable), "w max, h max, span 2, wrap");
		add(ExamplesUtil.createButtonsPanel(100, this.newButton,
				this.editButton, this.deleteButton), "w max, span 2, wrap");
	}

	public JButton getSearchButton() {
		return this.searchButton;
	}

	public void setSearchButton(JButton refreshButton) {
		this.searchButton = refreshButton;
	}

	public JButton getNewButton() {
		return this.newButton;
	}

	public void setNewButton(JButton newButton) {
		this.newButton = newButton;
	}

	public JButton getEditButton() {
		return this.editButton;
	}

	public void setEditButton(JButton editButton) {
		this.editButton = editButton;
	}

	public JButton getDeleteButton() {
		return this.deleteButton;
	}

	public void setDeleteButton(JButton deleteButton) {
		this.deleteButton = deleteButton;
	}

	public JTable getAuthorsTable() {
		return this.authorsTable;
	}

	public void setAuthorsTable(JTable authorsTable) {
		this.authorsTable = authorsTable;
	}

	public JTextField getSearchTitleTextField() {
		return this.searchTitleTextField;
	}

	public void setSearchTitleTextField(JTextField titleSearchField) {
		this.searchTitleTextField = titleSearchField;
	}

	public JTextField getSearchYearTextField() {
		return this.searchYearTextField;
	}

	public void setSearchYearTextField(JTextField yearSearchField) {
		this.searchYearTextField = yearSearchField;
	}

	public JTextField getSearchAuthorTextField() {
		return this.searchAuthorTextField;
	}

	public void setSearchAuthorTextField(JTextField authorSearchField) {
		this.searchAuthorTextField = authorSearchField;
	}

}
